const app = getApp();
const { imgPath } = require('../../utils/request')
Component({
  data: {
    imgPath: imgPath,
    selected: '0',
    color: "rgba(0,0,0,0.25)",
    selectedColor: "#00A7DC",
    list: [
      {
        "text": "箱包",
        "iconPath": "/images/cashService/barList.png",
        "selectedIconPath": "/images/cashService/barListOn.png"
      },
      {
        "text": "新箱包",
        "iconPath": "/images/cashService/xinjian.png",
        "selectedIconPath": "/images/cashService/barScan.png"
      },
      {
        "text": "我的",
        "iconPath": "/images/cashService/barUser.png",
        "selectedIconPath": "/images/cashService/barUserOn.png"
      }
    ]
  },


  attached() {
  },
  methods: {
    switchTab(e, mode) {
      let data = ''
      if (mode === 'manual') {
        data = e
      }else{
        data = e.currentTarget.dataset.index
      }
      if (data !== '1') {
        this.setData({
          selected: data
        })
      }
      this.triggerEvent('change', { id: data }, {})
    },
  }
})

